/*
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 */
using VOL.Core.BaseProvider;
using VOL.Entity.DomainModels;
using System.Collections.Generic;
using System.Threading.Tasks;
using VOL.Core.Utilities;

namespace VOL.demo.IServices
{
    public partial interface IproductinformationmodelService : IService<productinformationmodel>
    {
        /// <summary>
        /// 获取货品类型级联数据
        /// </summary>
        /// <returns></returns>
        object GetProductTypeCascade();

        /// <summary>
        /// 生成条码
        /// </summary>
        /// <param name="goodsId">货品ID</param>
        /// <param name="unitId">单位ID</param>
        /// <returns></returns>
        string GenerateBarcode(long goodsId, long unitId);

        /// <summary>
        /// 添加货品及详细信息
        /// </summary>
        /// <param name="productInfo">货品信息</param>
        /// <param name="unitRelations">单位关系</param>
        /// <param name="inventoryList">库存列表</param>
        /// <param name="imageList">图片列表</param>
        /// <returns></returns>
        WebResponseContent AddProductWithDetails(
            productinformationmodel productInfo,
            List<GoodsUnitRelationModel> unitRelations,
            List<InventoryModel> inventoryList,
            List<GoodsImageModel> imageList
        );

        /// <summary>
        /// 获取货品信息下拉选项
        /// </summary>
        /// <param name="keyword">搜索关键词</param>
        /// <param name="pageIndex">页码</param>
        /// <param name="pageSize">每页记录数</param>
        /// <returns>货品信息列表</returns>
        Task<(List<productinformationmodel> Data, int TotalCount)> GetProductOptionsAsync(
            string keyword = null, 
            int pageIndex = 1, 
            int pageSize = 10);

        /// <summary>
        /// 根据货品ID获取货品信息
        /// </summary>
        /// <param name="productId">货品ID</param>
        /// <returns>货品信息</returns>
        Task<productinformationmodel> GetProductByIdAsync(long productId);

        /// <summary>
        /// 根据货品ID列表批量获取货品信息
        /// </summary>
        /// <param name="productIds">货品ID列表</param>
        /// <returns>货品信息列表</returns>
        Task<List<productinformationmodel>> GetProductsByIdsAsync(List<long> productIds);

        /// <summary>
        /// 添加新产品
        /// </summary>
        /// <param name="product">产品信息</param>
        /// <returns>添加结果</returns>
        Task<WebResponseContent> AddProductAsync(productinformationmodel product);

        /// <summary>
        /// 检查产品编号是否已存在
        /// </summary>
        /// <param name="goodsCode">产品编号</param>
        /// <returns>存在返回true，不存在返回false</returns>
        Task<bool> IsProductCodeExistsAsync(string goodsCode);

        /// <summary>
        /// 分页查询货品详细信息（包含货品类型、供应商、客户名称）
        /// </summary>
        /// <param name="request">查询请求参数</param>
        /// <returns>分页查询结果</returns>
        Task<ProductQueryResult> GetProductsWithDetailsAsync(ProductQueryRequest request);
    }
}
